package org.duang.db.mongo.parser.decode;

import java.lang.reflect.Field;

import com.mongodb.DBObject;

public abstract class Decoder {

	protected Field field;
	protected DBObject dbo;
	protected Object value;
	
	public Decoder(DBObject dbo, Field field) {
		this.dbo = dbo;
		this.field = field;
		this.value = dbo.get(field.getName());
	}
	
	public Field getField() {
		return field;
	}
	
	public abstract String getFieldName();
    
    public abstract Object getFieldValue();
	
    public abstract boolean isNullField();
    
    public abstract void setObj(Object obj);
	
}
